<?php
class tintucdb {
    public function Them($MaTT, $TieuDe, $NoiDung, $HinhAnh, $TenAnh, $NgayDang, $MaND, $LuotXem, $KiemDuyet){
		$sql = "INSERT INTO `tintuc`(`MaTT`, `TieuDe`, `NoiDung`, `HinhAnh`, `TenAnh`, `NgayDang`, `MaND`, `LuotXem`, `KiemDuyet`)"
			+ "VALUES($MaTT, $TieuDe, $NoiDung, $HinhAnh, $TenAnh, $NgayDang, $MaND, $LuotXem, $KiemDuyet)";
		$data = new dataservice;
		return $data->ExecuteNoneQuery($sql);
	}
	
	public function Xoa($MaTT){
		$sql = "DELETE FROM `tintuc` WHERE MaTT = `$MaTT`";
		$data = new dataservice;
		return $data->ExecuteNoneQuery($sql);
	}
	
	public function LayDanhSach(){
		$sql = "SELECT * FROM `tintuc`";
		$data = new dataservice;
		return $data->ExecuteQuery($sql);
	}
}
?>
